package com.icw.decoupling.defi.proxy;

import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;

import com.icw.basis.BasePoEntity;
import com.icw.utility.query.IcwCriteria;
import com.icw.utility.query.PageCount;

public interface GenericSrvProxy {

	<T extends BasePoEntity> T one(Class<T> entityClass, String id) throws Exception;

	<T extends BasePoEntity> T save(T t) throws Exception;

	<T extends BasePoEntity> List<T> query(Class<T> entityClass, IcwCriteria criteria, PageCount page) throws Exception;

	<T extends BasePoEntity> void delete(Class<T> entClass, T obj) throws Exception;

	<T extends BasePoEntity> int countByCriteria(Class<T> entityClass, IcwCriteria criteria) throws Exception;

	<T extends BasePoEntity> int updateByCriteria(Class<T> entityClass, Map<String, Object> contains, IcwCriteria cri) throws Exception;

	<T extends BasePoEntity> int deleteByCriteria(Class<T> entityClass, IcwCriteria cri) throws Exception;

	<T extends BasePoEntity> T findByName(Class<T> entityClass, String name) throws Exception;

	<T> T exec(Callable<T> call) throws Exception;
}
